home *** CD-ROM | disk | FTP | other *** search
/ C & C++ Multimedia Cyber Classroom / C and C++ Multimedia Cyber Classroom (Prentice Hall) (1998).iso / cpphtp2 / code.jar / code / ch03 / fig03_24.txt < prev    next >
Text File  |  1998-02-27  |  457b  |  18 lines

  1. 1   // Fig. 3.24: fig03_24.cpp
  2. 2   // Using the unary scope resolution operator
  3. 3   #include <iostream.h>
  4. 4   #include <iomanip.h>
  5. 5   
  6. 6   const double PI = 3.14159265358979;
  7. 7   
  8. 8   int main()
  9. 9   {
  10. 10     const float PI = static_cast< float >( ::PI );
  11. 11  
  12. 12     cout << setprecision( 20 )
  13. 13          << "  Local float value of PI = " << PI
  14. 14          << "\nGlobal double value of PI = " << ::PI << endl;
  15. 15  
  16. 16     return 0;
  17. 17  }
  18.